# Copyright (c) 2023 Presto Labs Pte. Ltd.
# Author: yuxuan

from functools import partial

from absl import flags
from absl.flags import *


def _check_define(func, name, value, help):
  if name not in dir(flags.FLAGS):
    func(name, value, help)


DEFINE_bool = partial(_check_define, flags.DEFINE_bool)
DEFINE_boolean = partial(_check_define, flags.DEFINE_boolean)
DEFINE_float = partial(_check_define, flags.DEFINE_float)
DEFINE_integer = partial(_check_define, flags.DEFINE_integer)
DEFINE_list = partial(_check_define, flags.DEFINE_list)
DEFINE_string = partial(_check_define, flags.DEFINE_string)
